<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<html style="font-size:50px;" g_init="2210240201807052118">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>登录注册</title>
    <link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/aem-h5.css"/>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/LCalendar.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/sexSelect.css"/>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet">
    <style>
         #bodyid {
	            background: url(<%=path%>/images/marketing/activity_success_bg.png) no-repeat;
	            background-size: 100% 100%;
        }
        .entrance {
        	height: 100%;
        	overflow: scroll;
        }
        .entrance-bg {
        	height: 2rem;
        	position: relative;
        }
        .logo-tt {
        	position: absolute;
    		bottom: 0;
        }
        .entrance .tab-bg {
        	margin: 0 auto 100px auto;
        }
    </style>
</head>
<body id="bodyid" style="display:none">
<div id="app">
    <div>
        <input type="hidden" value="<%=path%>" id="pathId">
        <div class="entrance">
            <div class="entrance-bg" style="padding-top:.60rem;margin-bottom:.2rem;">
                <img class="logo" src="">
                <div class="logo-tt" style="margin:.2rem auto 0;"></div>
            </div>
            <div class="tabBackgroud">
	            <div class="tab-bg">
	                <div class="mint-navbar" id="navbarid">
	                    <a class="mint-tab-item is-selected">
	                        <div class="mint-tab-item-icon"></div>
	                        <div class="regTabText">注册</div>
	                    </a>
	                    <a class="mint-tab-item">
	                        <div class="mint-tab-item-icon"></div>
	                        <div class="loginTabText">登录</div>
	                    </a>
	                </div>
	                <div class="mint-tab-container" id="tabconid">
	                    <ul class="mint-tab-container-item current" id="reginfo" style="display:block;">
	                        <ul class="login-bg">
	                            <div id="innerHtmlid">
	                                <!-- <li><div>
	                                        <span class="tt">姓名 ：</span><input placeholder="请输入姓名" class="item-input"/>
	                                    </div>
	                                </li>
	                                <li><div>
	                                        <span class="tt">手机 ：</span><input placeholder="请输入手机" class="item-input"/>
	                                    </div>
	                                </li> -->
	                            </div>
	                            <li>
	                                <div class="border-none">
	                                    <div class="left" style="display: flex;">
	                                        <span class="tt">验证码 :</span><input placeholder="短信验证码" id="smsRegCode"
	                                                                         style="margin-top:-8px;"  class="item-input message"/>
	                                    </div>
	                                    <div class="item-input code regSendCode" style="width:auto;margin-top:-8px;" data-flag="1">发送验证码</div>
	                                </div>
	                            </li>
	                            <li>
	                                <div style="border-bottom:.02rem solid #d8d8d8;">
	                                    <span class="tt">邀请码 ：</span><input placeholder="部门邀请码" id="deptCode"
	                                                                        class="item-input"/>
	                                </div>
	                            </li>
	                        </ul>
	                        <div class="remind" id="regRemind" style="top:auto;margin-top:-10px;">
	                            <div class="remind-ct" style="width:200px;">
	                                <img
	                                        src="">
	                                <span id="viewregRem">验证码输入错误</span>
	                            </div>
	                        </div>
	                        <div class="login digister regBtn" style="margin:0.8rem auto 0 !important;">注册</div>
	                    </ul>
	                    <ul class="mint-tab-container-item current" id="loginfo" style="display:none;">
	                        <ul class="login-bg">
	                            <li>
	                                <div style="border-bottom:.02rem solid #d8d8d8;">
	                                    <span class="tt">手机号 ：</span><input id="loginPhone" placeholder="请输入手机号码"
	                                                                        class="item-input"/>
	                                </div>
	                            </li>
	                            <li>
	                                <div class="border-none">
	                                    <div class="left" style="display: flex;">
	                                        <span class="tt">验证码 :</span><input id="smsLogCode" placeholder="短信验证码"
	                                                                         style="margin-top:-8px;"  class="item-input message"/>
	                                    </div>
	                                    <div  class="item-input code loginSendCode" style="width:auto;margin-top:-8px;" data-flagone="1">发送验证码</div>
	                                </div>
	                            </li>
	                        </ul>
	                        <div class="remind" id="logRemind" style="top:auto;margin-top:-10px;">
	                            <div class="remind-ct" style="width:200px;">
	                                <img
	                                        src="">
	                                <span id="logViewRem">验证码输入错误</span>
	                            </div>
	                        </div>
	                        <div class="login digister loginBtn" style="margin:0.8rem auto 0 !important;">登录</div>
	                    </ul>
	                </div>
	            </div>
          </div>
        </div>
    </div>
</div>
</body>
</html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!-- 登录注册脚本 - Yanghc -->
<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
<script type="text/javascript">
    var path = "<%=path%>";
    var bgColor;
    var openId;
    var headImgUrl;
    var priview=2;
    var cid;
    var result = new Array();
    $(function () {
    	if(getQueryString('priview')!=null){
    		priview=getQueryString('priview');
    	}
        openId = getQueryString('openId');
        headImgUrl = getQueryString('headImgUrl');
        cid = getQueryString('cid');
        
         var weixinAuthUrl = path + "/api/auth/getAuthUrl";
        if (openId == null || headImgUrl == null) {
            console.log('openId或者头像为空，返回授权页面获取最新资料');
            $.ajax({
                type: "post",
                url: weixinAuthUrl,
                async: false,
                data: {
                    "cid": cid,
                    "redirectUrl": window.location.href
                },
                success: function (data) {
                    if (data.status == '200') {
                        window.location.href = data.data;
                    } else {
                        console.log('系统获取授权地址异常！');
                    }
                }
            });
        }
        $("#regRemind").hide();
        $("#logRemind").hide();
        aemRegLogin.init(cid,priview).loadStaffProData();
        bgColor = aemRegLogin.tabBackColor;
        
        //加载部门编码，自动补全功能
        var url =path+"/aem/client/loadDepartMentCodeInfo";
        $.post(url, {
           	 	"cid":cid
   	    	 }, function(data) {
   	    		if (data.status == 200) {
   	    			insertOptions(data.data);
   	    		}else{
   	    			aemRegLogin.remind(data.message);
   		        }
   	     },"json");
        var insertOptions = function(data) {
            $.each(data, function(i, item){
                result.push(item);
            });
        }
        
        //自动补全
        $('#deptCode').keyup(function(){
        	$("#deptCode").autocomplete({
            	mustMatch:true,
                source: result,
                select: function(event, ui) {
                	var itemVa=ui.item.value;
                	var arr=itemVa.split("-");
                	ui.item.value=arr[arr.length-1];
                }
            });
        });
    });

    //tab 切换
    $('#navbarid a').click(function () {
        var i = $(this).index();
        $(this).addClass('is-selected').siblings().removeClass('is-selected');
        if (bgColor != null) {
            $(this).addClass('is-selected').siblings().removeAttr("style");
        }
        $(".current").hide();
        if (i == 0) {
            $("#reginfo").show();
        } else {
            $("#loginfo").show();
        }
        if (bgColor != null) {
            $(".is-selected").css("border-bottom", "2px solid" + bgColor);
            $(this).removeClass("is-selected");
        }
    });
</script>
<script type="text/javascript" src="<%=path%>/js/aem/client/aem-reglogin-load.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/aem-reglogin-control.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/js/framework7.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/regionsObject2.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/cityPicker.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/LCalendar.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/sexSelect.js"></script>
<script type="text/javascript" src="<%=path%>/js/marketing/validation.js"></script>
<script type="text/javascript" src="<%=path%>/js/dateUtils.js"></script>